<!DOCTYPE html>
<title>Ensure overflow menu buttons are hidden when resizing.</title>
<script src='../../resources/testharness.js'></script>
<script src='../../resources/testharnessreport.js'></script>
<script src='../media-controls.js'></script>
<video controls></video>
<script>
async_test(t => {
  if (window.testRunner)
    testRunner.useUnfortunateSynchronousResizeMode();

  // Set up video
  const video = document.querySelector('video');
  video.src = '../content/test.ogv';
  const track = video.addTextTrack('captions');

  video.onloadeddata = t.step_func(() => {
    const menu = overflowMenu(video);

    singleTapOnControl(overflowButton(video), t.step_func(() => {
      assert_not_equals(getComputedStyle(menu).display, 'none');

      window.onresize = t.step_func_done(_ => {
        assert_equals(getComputedStyle(menu).display, 'none');
      });
      window.resizeTo(500, 500);
    }));
  });
});
</script>
